//
//  YKOrderDetailHeaderView.m
//  YunKang
//
//  Created by leoking870 on 2017/10/2.
//  Copyright © 2017年 leoking870. All rights reserved.
//

#import "YKOrderDetailHeaderView.h"

@interface YKOrderDetailHeaderView ()
@property (weak, nonatomic) IBOutlet UILabel *C_NAME;
@property (weak, nonatomic) IBOutlet UIButton *ST_NAME;
@property (weak, nonatomic) IBOutlet UILabel *CID;
@property (weak, nonatomic) IBOutlet UILabel *DCREATESYSTIME;
@property (weak, nonatomic) IBOutlet UILabel *buyerAccountLabel;
@property (weak, nonatomic) IBOutlet UIImageView *CS_NAME;
@property (weak, nonatomic) IBOutlet UILabel *orderStatusLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderPriceLabel;

@end



@implementation YKOrderDetailHeaderView

- (void)setMYKOrderDetailModel:(YKOrderDetailModel *)mYKOrderDetailModel {
    self.C_NAME.text = mYKOrderDetailModel.customerDataMap.C_NAME;
    [self.ST_NAME setTitle:mYKOrderDetailModel.customerDataMap.ST_NAME forState:UIControlStateNormal];
    self.CID.text = [NSString stringWithFormat:@"订单单号: %@",mYKOrderDetailModel.orderMap.CSOCODE];//mYKOrderDetailModel.orderMap.ID;
    self.DCREATESYSTIME.text = [NSString stringWithFormat:@"订单日期: %@",mYKOrderDetailModel.orderMap.DCREATESYSTIME];
    self.buyerAccountLabel.text = [NSString stringWithFormat:@"下单会员: %@ %@", mYKOrderDetailModel.orderMap.USER_NAME, mYKOrderDetailModel.orderMap.CCUSHAND];
    self.CS_NAME.hidden = ![mYKOrderDetailModel.customerDataMap.CS_NAME isEqualToString:@"已认证"];
    
    self.orderStatusLabel.text = [NSString stringWithFormat:@"订单状态:%@", mYKOrderDetailModel.orderMap.iStatusString];
    if ([mYKOrderDetailModel.orderMap.ISTATUS isEqualToString:@"9"]) {
        self.orderPriceLabel.text = @"退货金额:--";
    }
    else if ([mYKOrderDetailModel.orderMap.ISTATUS isEqualToString:@"10"]){
        self.orderPriceLabel.text = [NSString stringWithFormat:@"退货金额: %@", mYKOrderDetailModel.orderMap.RETURNSUM];
    }
    else {
        self.orderPriceLabel.text = [NSString stringWithFormat:@"订单金额: %@", mYKOrderDetailModel.orderMap.ZDSUM];
    }
}


@end
